<?php

class MobileAccountController extends MobileController {

    static $model_name = 'account';
    static $display_name = '财务情况';
	/*
	|--------------------------------------------------------------------------
	| Default Home Controller
	|--------------------------------------------------------------------------
	|
	| You may wish to use controllers instead of, or in addition to, Closure
	| based routes. That's great! Here is an example controller method to
	| get you started. To route to this controller, just add the route:
	|
	|	Route::get('/', 'HomeController@showWelcome');
	|
	*/

	public function getIndex()
	{
        $title = '财务情况';
        $result =  $this->getService()->getAccountLogList($this->member, array(), 8);
        $entries = $result['entries'];
        $links = $result['links'];
        $member = $this->member;

        return View::make(self::$view_path.'.'.self::$model_name.'.list', compact('entries', 'member', 'title', 'links'));
	}

    public function getService() {
        if(is_null($this->service)){
            $this->service = new MobileAccountService();
        }
        return $this->service;
    }

}
